@extends('layouts.app')

@section('title','EditSunPicture')

@section('content')
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                    <a class="create-return" href="{{ route('sunPicture.index') }}">
                        <span><i class="fa fa-chevron-circle-left fa-2x" aria-hidden="true"></i></span>
                        <span>返回</span>
                    </a>

                    <div class="create">
                    <div class="create-title">编辑晒图信息</div>
                        {!! Form::model($sunPicture, ['action' => ['sunPictureController@update',$sunPicture->id], 'files' => true]) !!}
                        <input name="_method" type="hidden" value="PATCH">
                        {{ csrf_field() }}

                        <div class="create-list{{ $errors->has('posts_content')?'has-error':'' }}">
                            {!! Form::label('posts_content','帖子内容名:')!!}
                            {!! Form::text('posts_content',$sunPicture->posts_content)!!}
                            @if ($errors->has('posts_content'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('posts_content') }}</strong>
                                </span>
                            @endif
                        </div>
                        
                        <div class="create-list">
                            {!! Form::label('posts_pic','帖子图片:')!!}
                            <div class="input-group">
                                <img src="/uploads/avatars/{{ $sunPicture->posts_pic }}" title="preview-img"/>
                                {!! Form::file('posts_pic'); !!}
                                @if ($errors->has('posts_pic'))
                                    <div class="help-block">
                                        <strong>{{ $errors->first('posts_pic') }}</strong>
                                    </div>
                                @endif
                            </div>
                        </div>
                        <div class="create-list{{ $errors->has('comments_count')?'has-error':'' }}">
                            {!! Form::label('comments_count','个人简介') !!}
                            <div class="input-group">
                                {!! Form::textarea('comments_count',$sunPicture->comments_count) !!}
                                @if ($errors->has('comments_count'))
                                    <span class="help-block">
				                        <strong>{{ $errors->first('comments_count') }}</strong>
				                    </span>
                                @endif
                            </div>
                        </div>
                        {!! Form::submit('更新帖子信息',['class'=>"btn btn-success"]); !!}
                        {!! Form::close() !!}
                    </div>
                    <div id="debug"></div>
            </div>
        </div>
    </div>

@endsection